import * as actionTypes from './actionTypes';
import actions from '../book/actions';

const mutations = {
    getData: value => ({
        type: actionTypes.GET_DATA,
        detailsList:value
    })
};

const active = {
    /**
     * 获取详情列表
     */
    getDetailsAct: () => {
        return (dispatch, setState) => {
            fetch("http://106.52.37.222:3000/xq")
            .then(response => response.json())
            .then(res => {
                console.log(res);
                dispatch(mutations.getData(res));
            })
        }
    }
};

export default active;
